package com.study.excel.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.study.excel.model.EmployeeExcelModel;

import java.util.ArrayList;
import java.util.List;

/**
 * 分析事件监听器
 */
public class EmployeeExcelHandler extends AnalysisEventListener<EmployeeExcelModel> {

    List<EmployeeExcelModel> list = new ArrayList<>();

    @Override
    public void invoke(EmployeeExcelModel employeeExcelModel, AnalysisContext analysisContext) {
        list.add(employeeExcelModel);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    public List<EmployeeExcelModel> getList(){
        return list;
    }
}
